<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>新华投票系统v1.0</title>
</head>
<body>
<?php

if(!isset($_COOKIE['islogin']) || $_COOKIE['islogin']!=1){
    echo "<script>window.navigate('login.php');</script>";
}

if(isset($_GET['action'])){
    require('config.php');
    $vsID = $_GET['action'];
    $del_query = "delete vote_subject,vote_item from vote_subject left join vote_item on vote_subject.vsID=vote_item.vsID where vote_subject.vsID=$vsID";
    $result_del = mysql_query($del_query) or die(mysql_error());
    if($result_del>0){
        echo "<script>alert('删除投票成功!');window.navigate('manager-vote.php');</script>";

    }
}

?>

</body>
</html>